home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
boe.pres.k12.wv.us
/
boe.pres.k12.wv.us.zip
/
boe.pres.k12.wv.us
/
Utilities
/
Xerox Workcentre 5335
/
Windows Scan
/
32-bit_x86
/
Ukrainian
/
cpsimage.cab
/
data
/
documentio.ucm
< prev
next >
Wrap
Text File
|
2009-03-16
|
19KB
|
314 lines
# $Id: documentio.ucm,v 1.44 2009/01/17 20:21:06 kingsley Exp $
#
# DocumentReader and Document writer objects
# These objects are used to read and write multi-page documents
# to and from XIPIMAGE objects
#
# For a description of how this file works, see Appendix C of
# Architecture document at XIPS web page.
# http://codex.xerox.com/projects/xips or
# http://www.wrc.xerox.com/~campanel/xips
#
<OBJECTS>
[DOCUMENTIO]
private: iohandle "void* private" Desc=Private handle used with IO lib
private: filename STRING Desc=Name of source file
private: format INTEGER Desc=Type of file format
private: version INTEGER Desc=The subtype or version of the format
private: pagecnt INTEGER Desc=Number of pages in the document
private: testfile BOOLEAN Desc=remove variable data for checksum
[DOCUMENTREADER]
parent: DOCUMENTIO
private: fngetpagecnt "void* private" Desc=Private overload function for getPageCount
private: fngetchecksum "void* private" Desc=Private overload function for getChecksum
private: fngetpage "void* private" Desc=Private overload function for getPage
private: fnrelease "void* private" Desc=Private overload function for release
method: getChecksum Native=DocReadChecksum@documentio \
Output=sum.INTEGER \
Desc=Calculate a checksum for the document.
method: getFilename Native=DocReadMethods@documentio \
Output=filename.STRING \
Desc=Return the filename of the backing data
method: getFormat Native=DocReadMethods@documentio \
Output=format.STRING, subtype.STRING \
Desc=Return the format of the backing data
method: getPageCount Native=DocReadMethods@documentio \
Output=num.INTEGER \
Desc=Return the number of pages in the document.
method: getPage Native=DocReadMethods@documentio \
Input=pgnum.INTEGER \
Output=img.XIPIMAGE \
Desc=Make an XIPImage from the requested page. The first\
page is 1. Data is the raw (i.e. compressed) file data.
method: release Native=DocReadMethods@documentio \
Desc=Release all resources used by this object. Close the\
backing store (i.e. file).
method: query Native=DocQuery@documentio \
Input=name.STRING, \
Output=results.LIST \
Desc=Query a reader to see if it contains something.
desc: {
// DESCRIPTION
A DOCUMENTREADER is a high-level representation of a document source. It provides
access to information and pages of a file that contains a document. A reader may be created
using the function CreateDocumentReader. A reader may be constructed from a filename.
DOCUMENTREADER is a simple interface to several file formats which include PDF (with limits),
Microsoft XPS, TIFF, JPEG (JFIF), PNG, GIF, and BMP.
}
[DOCUMENTWRITER]
parent: DOCUMENTIO
private: fnsetattr "void* private" Desc=Private overload function for SetAttributes
private: fnappendpage "void* private" Desc=Private overload function for appendPage
private: fninsertpage "void* private" Desc=Private overload function for insertPage
private: fnrelease "void* private" Desc=Private overload function for release
private: transspecs "struct _ELFLIST*" Desc=List of TRANSFORMSPEC objects that describe \
acceptable specifications for pages to be appended.
private: attributes "struct _ELFLIST*" Desc=List of attributes, both document model and format \
specific. Attributes include those used for the \
container, the page, and individual objects on a page.
method: getFilename Native=DocWriteMethods@documentio \
Output=filename.STRING \
Desc=Return the filename of the backing data
method: getFileSize Native=DocWriteMethods@documentio \
Output=size.INTEGER \
Desc=Return the current size of actual file
method: getFormat Native=DocWriteMethods@documentio \
Output=format.STRING, subtype.STRING \
Desc=Return the format of the backing data
method: getPageCount Native=DocWriteMethods@documentio \
Output=num.INTEGER \
Desc=Return the number of pages added to the document.
method: listSpecs Native=DocWriteMethods@documentio \
Output=speclist.LIST\
Desc=Return a list of one or mode specification lists for this writer.
method: refSpecs Native=DocWriteMethods@documentio \
Output=speclist.LIST\
Desc=Return a reference to the internal list specification lists.
method: setAttr Native=DocWriteMethods@documentio \
Input=name.STRING, obj.OBJECT \
Desc=Set named parameters into to object \
attributes. If the name is already there, it will be \
replaced with the new value.
method: getAttr Native=DocWriteMethods@documentio \
Input=name.STRING \
Output=obj.OBJECT \
Desc=Get the named attribute. If no name \
is passed in,the entire list is returned;
method: clearAttr Native=DocWriteMethods@documentio \
Input=name.STRING \
Desc=Clear the named attribute. If no name\
is passed in, the entire list is removed;
method: appendPage Native=DocWriteMethods@documentio \
Input=pgImg.XIPIMAGE \
Output=num.INTEGER \
Desc=Add this XIPImage at the end of the current document.\
Return the total count of pages including this page.
method: insertPage Native=DocWriteMethods@documentio \
Input=pgImg.XIPIMAGE \
Output=num.INTEGER \
Desc=Add this XIPImage at the beginning of the current document.\
Return the total count of pages including this page.
method: release Native=DocWriteMethods@documentio \
Desc=Release all resources used by this object. Close the\
backing store (i.e. file).
method: releaseJbig2 Native=DocWriteMethods@documentio \
Desc=Release all JBIG2 resources used by this object. \
Flushes the JBIG2 entities and frees the JBIG2 codec \
handle. \
desc: {
// DESCRIPTION
A DOCUMENTWRITER is a high-level representation of a document sink. Once constructed,
it allows control over a few basic attributes, some of which are format related. It also allows
scripted code to append pages (XIPIMAGE). It is assumed that the pages will prepared as
needed prior to appending to the writer. With the exception of compression, the various
embedded writers are not capable of significant processing. The current set of attributes
are listed in Doc Attributes page of the Document Mgr section.
Each DOCUMENTWRITER contains a LIST of one or more TRANSFORMSPEC objects. The TRANSFORMSPEC
provides information about the ability of the associated file format to contain page content.
For example, a JFIF file is limited to contone image data, it can only carry JPEG compressed
data, it can be of any width and height, it can not carry mixed raster content, etc.
The format specific information within a TRANSFORSPEC is not human friendly. Typically, the
specification is used with the TransformPage funtion to prepare a XIPIMAGE prior to appending
it to the DOCUMENTWRITER.
A writer may be constructed from as little as a filename using CreateDocumentWriter function.
Several file formats are currently supported: PDF, Microsoft XPS, TIFF, JPEG (JFIF), PNG, GIF,
and BMP.
}
[FONTDIO]
private: fntHnd "void* private" Desc=Private handle used in C code
method: getName Native=FontDioMethods@documentio \
Output=name.STRING \
Desc=Get the name used in text commands for this font
method: getSrcID Native=FontDioMethods@documentio \
Output=name.STRING \
Desc=Get the unique ID that identifies this font in the source
desc: {
// DESCRIPTION
A FONTDIO is the representation of a font. A font object may be associated with text. It is
usually constructed and associated by the DOCUMENTREADER. Currently, the primary use is internal
to the DOCUMENTWRITER.
}
[TRANSFORMSPEC]
private: coreImage "struct _ELFPOINTER*" Desc=ptr to core imaging specifications.
private: attributes "struct _ELFLIST*" Desc=General attributes
method: initByImage Native=TransformSpecMethods@documentio \
Input=image.XIPIMAGE \
Desc=Set the core specifications to match a given image.
method: matchList Native=TransformSpecMethods@documentio \
Input=speclist.LIST \
Output=nearmatch.TRANSFORMSPEC, exact.BOOLEAN \
Desc=Compare each TRANSFORMSPEC found in the input list to the \
specifications of this object and return the nearest match. \
The value return for exact is true if this is an exact match. \
Rules for matching; (1) Any named item in this object not found \
in a TRANSFORMSPEC of the speclist is assumed exact match. (2) Any \
named item in a TRANSFORM SPEC of the speclist but not in this spec \
is assumed acceptable but not an exact match.
method: toList Native=TransformSpecMethods@documentio \
Output=list.LIST \
Desc=Return a list that contains all of the specifications of this object.
method: setAttr Native=TransformSpecMethods@documentio \
Input=name.STRING, obj.OBJECT \
Desc=Set named parameters into to object \
attributes. If the name is already there, it will be \
replaced with the new value.
method: getAttr Native=TransformSpecMethods@documentio \
Input=name.STRING \
Output=obj.OBJECT \
Desc=Get the named attribute. If no name \
is passed in,the entire list is returned
method: clearAttr Native=TransformSpecMethods@documentio \
Input=name.STRING \
Desc=Clear the named attribute. If no name\
is passed in, the entire list is removed;
method: isMRC Native=SpecIsMRC@documentio \
Output=hasmrc.BOOLEAN \
Desc=Find out if this one has multiple layers
method: setPageSpec Native=TransformSpecPage@documentio \
Input=mrc.BOOLEAN, singlePagePerFile.BOOLEAN, \
portrait.BOOLEAN, landscape.BOOLEAN \
Desc=Set core values for the page specifications. One or more values \
may be given. All others will remain unchanged.
method: setRasterSpec Native=TransformSpecRasters@documentio \
Input=maxBitDepth.INTEGER, disallow.BOOLEAN, maxXRes.INTEGER, maxYRes.INTEGER, \
photometry.LIST, compression.INTEGER, jpegquality.INTEGER, jbig2arith.BOOLEAN, \
interleave.INTEGER, width.INTEGER, height.INTEGER \
Desc=Set core values for the page rasters. maxBitDepth is required (1, 8, 24). \
It will determine if the other given values apply to binary or contone rasters.\
To disallow either binary or contone, use the disallow flag. Any other given \
value will force that type of raster to be enabled. See XIPS defined constants \
for valid values used with compression, photometry, and interleave. Jpegquality \
may be 0..100. jbig2arith = TRUE will cause arithmetic coding to be used when \
JBIG2 compression is done.
method: testPhotom Native=TransformSpecMethods@documentio \
Input=photometry.INTEGER \
Output=isMatch.BOOLEAN \
Desc=Test this TRANSFORMSPEC for a match with the given Photometry.
method: testDepth Native=TransformSpecMethods@documentio \
Input=inSpec.TRANSFORMSPEC, pulling.BOOLEAN, reduce.BOOLEAN \
Output=needed.BOOLEAN, result.TRANSFORMSPEC \
Desc=Test inSpec against this specification to know if bit depth \
adjustment is needed. If reduce is TRUE, bit depth reduction is tested, \
otherwise test for expanding bit depth (i.e 1 bit to 8).
method: testOrient Native=TransformSpecMethods@documentio \
Input=inSpec.TRANSFORMSPEC, pulling.BOOLEAN, degrees.INTEGER \
Output=needed.BOOLEAN, result.TRANSFORMSPEC, amount.INTEGER \
Desc=Test inSpec against this specification to find amount of rotation \
needed to correct orientation.
method: testCompress Native=TransformSpecMethods@documentio \
Input=inSpec.TRANSFORMSPEC, pulling.BOOLEAN, decode.BOOLEAN \
Output=needed.BOOLEAN, result.TRANSFORMSPEC, cinfo.LIST \
Desc=Test inSpec against this specification to determine if any compression \
is needed. If decode is TRUE, this will test for the need to decompress.
method: testFlat Native=TransformSpecMethods@documentio \
Input=inSpec.TRANSFORMSPEC, pulling.BOOLEAN \
Output=needed.BOOLEAN, result.TRANSFORMSPEC \
Desc=Test inSpec against this specification to determine if flatten is needed.
method: testSegment Native=TransformSpecMethods@documentio \
Input=inSpec.TRANSFORMSPEC, pulling.BOOLEAN \
Output=needed.BOOLEAN, config.STRING, result.TRANSFORMSPEC \
Desc=Test inSpec against this specification to determine if segmentation is needed.
method: testSize Native=TransformSpecMethods@documentio \
Input=inSpec.TRANSFORMSPEC, pulling.BOOLEAN \
Output=needed.BOOLEAN, result.TRANSFORMSPEC, sfact.DOUBLE, \
xsize.INTEGER, ysize.INTEGER, xres.DOUBLE, yres.DOUBLE \
Desc=Test inSpec against this specification to determine if scale/rescon is \
needed. The return values reflect the resultant size and resolution required.
method: testAffine Native=TransformSpecMethods@documentio \
Input=inSpec.TRANSFORMSPEC, pulling.BOOLEAN \
Output=needed.BOOLEAN, result.TRANSFORMSPEC \
Desc=Test inSpec against this specification to determine if affine is needed.
desc: {
// DESCRIPTION
The TRANSFORMSPEC is used to describe various aspects of a page with respect to a file
format writer, i.e. DOCUMENTWRITER. Currently, the specification focus is on a few page items
and the specification of raster layers. Typically, the objects are acquired from a writer
in order to prepare a XIPIMAGE for appending to that writer. This is usually done by getting
the DOCUMENTWRITER's list of TRANSFORMSPECs with a call to refSpecs. The specification may
be tailored as needed, by calls to setPageSpec and setRasterSpec. Finally, the TransformPage
function is used to prepare a given XIPIMAGE for the desired specification.
}
<FUNCTIONS>
function: XIPXMLtoXPSXML Native=XIPXML2XPSXML@documentio \
Input=xipxml.s, width.d, height.d, xres.d, yres.d, matrix.LIST \
Output=xpsxml.s, font.s \
DESC=Converts internal XML OCR format to XML for XPS container. The ratio between \
width(height) and the width(height) embedded in xipxml determine the x(y)-scaling \
performed during output. Returned value is a STRING object.
function: XIPXMLtoText Native=XIPXML2Text@documentio \
Input=xipxml.s \
Output=text.s \
DESC=Converts internal XIPXML OCR text to simple text with trying to account for \
text positioning by adding spaces and carriage returns.
function: CreateDocumentReader Native=MakeDocReader@documentio \
Input=filename.STRING \
Output=docrd.DOCUMENTREADER \
Desc=The object returned will support the file format found in \
the given file. No object will be returned if the format is not \
supported or if the file can not be accessed.
function: CreateDocumentWriter Native=MakeDocWriter@documentio \
Input=filename.STRING, format.STRING, subtype.STRING, testfile.BOOLEAN \
Output=docwt.DOCUMENTWRITER \
Desc=A new writer will be returned which supports the file format needed. \
The file format is determined by first looking for a format. If no format \
has been named, the extension of the filename is used. The version is optional. \
Formats are; TIFF (versions - v6 or tn2); TIFFFX (versions - S,F,C); PDF \
(versions - 1.3, 1.4, 1.7); JFIF; and standard XE writers.
function: PDFDecompose Native=PDFDecompose@documentio \
Input=filename.STRING, destname.STRING \
Output=pgcnt.INTEGER \
Desc=Parse and decompse a PDF file into a text files that contain \
information about objects in the PDF file.